package com.fourpigeon.controller;

import com.fourpigeon.domain.Result;
import com.fourpigeon.service.FollowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
//
@Slf4j
@RestController
@RequestMapping("/follow")
public class FollowController {
    @Autowired
    private FollowService followService;
    @PostMapping("/foc/{tarId}")
    public Result follow(@PathVariable Long tarId){return followService.follow(tarId);}
    @GetMapping("/or/not/{tarId}")
    public Result isFollow(@PathVariable Long tarId){return followService.isFollow(tarId);}
    @GetMapping("/myFollows")
    public Result myFollows(){return followService.myFollows();}
    @GetMapping("/{userId}")
    public Result tarFollows(@PathVariable Long userId){return followService.tarFollows(userId);}
    @GetMapping("/myFollowers")
    public Result myFollowers(){return followService.myFollowers();}
    @GetMapping("/followers/{tarId}")
    public Result tarFollowers(@PathVariable Long tarId){return followService.tarFollowers(tarId);}
    @GetMapping("/common/{tarId}")
    public Result getCommonFollows(@PathVariable Long tarId){return followService.getCommonFollows(tarId);}
}
